home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************************
- #
- # CustomApp.h
- #
- # This is a simple application shell that we use to handle the standard mac stuff.
- # In general, the routines in this code should be as generic as possible, and any
- # custom code should be included in CustomApp.c instead. See CustomApp.h for a list
- # of the routines that need to be provided by the custom application.
- #
- # Shell.h also includes all the debugging macros and application conditionals, so
- # is should be included by all project files.
- #
- # Author: Timothy Carroll
- # Apple Developer Technical Support
- # timc@apple.com
- #
- # Revision: Jason Yeo
- #
- # Modification History:
- #
- # 2/9/97 TMC Initial Release
- #
- # 9/12/97 JY Updated for:
- # TEC 1.2.1
- # Universal Interfaces 3.0
- # CodeWarrior 11 projects
- #
- # Copyright © 1997 Apple Computer, Inc., All Rights Reserved
- #
- #
- # You may incorporate this sample code into your applications without
- # restriction, though the sample code has been provided "AS IS" and the
- # responsibility for its operation is 100% yours. However, what you are
- # not permitted to do is to redistribute the source as "DSC Sample Code"
- # after having made changes. If you're going to re-distribute the source,
- # we require that you make it clear in the source that the code was
- # descended from Apple Sample Code, but that you've made changes.
- #
- *************************************************************************************/
-
- #ifndef __CUSTOMAPP__
- #define __CUSTOMAPP__
-
- #pragma once
-
- #include "Shell.h"
-
- /*************************************************************************************
- # REQUIRED CONSTANTS
- #
- # The Shell uses these to customize the application's behavior.
- *************************************************************************************/
-
- // We'll use these constants to tailor the Application's behavior.
-
- enum
- {
- kEventInterval = 3, // How often to check for events
- kNumberOfMasters = 10, // # of initial MoreMaster calls to make
- kSleepTime = 15 // How much time we'll give when in the background.
- };
-
-
- // Menu constants
-
- // Constants for the various menu items
- enum
- {
- rMenuBar = 128,
- mAppleMenu = 128,
- iAboutApp = 1,
- mFileMenu = 129,
- iConvert = 1,
- iQuit = 3,
- mEditMenu = 130,
- iUndo = 1,
- iCut = 3,
- iCopy = 4,
- iPaste = 5,
- iClear = 6,
- iSelectAll = 8,
- iPreferences = 10
-
- };
-
-
-
-
- /*************************************************************************************
- # REQUIRED APPLICATION ROUTINES
- #
- # All of these routines are required. The Shell portion calls these routines to
- # handle various events, such as initializing the app, handling Apple events, and
- # termination ofthe app.
- *************************************************************************************/
- OSStatus InitApp (void);
- OSStatus TerminateApp (void);
-
- Boolean AppWantsTime (void); // Should return true if the app wants idle time between events
- OSStatus TimeSlice (void); // This routine is called when the app wants idle time
-
- OSStatus HandleEvent (EventRecord *theEvent);
-
- pascal OSErr HandleOpenAppEvent (AppleEvent *event, AppleEvent *reply,long refCon);
- pascal OSErr HandleOpenDocEvent (AppleEvent *event, AppleEvent *reply,long refCon);
- pascal OSErr HandlePrintDocEvent (AppleEvent *event, AppleEvent *reply,long refCon);
- pascal OSErr HandleQuitAppEvent (AppleEvent *event, AppleEvent *reply,long refCon);
-
- #endif // __CUSTOMAPP__